
#ifndef TWS_NOTIFY_H 
#define TWS_NOTIFY_H 

#ifdef __cplusplus
extern "C"{
#endif

/*----------------------------------include-----------------------------------*/
#include "cpu.h"
/*-----------------------------------macro------------------------------------*/

/*----------------------- NOTIFY METHON CONTROL ------------------------------*/
#define TWS_NOTIFY_METHOD_SPP
/*----------------------------------------------------------------------------*/


#define TWS_NOTIFY_ERR_UNKNOWN 0
#define TWS_NOTIFY_ERR_ADDR_INVALID -1
/*----------------------------------typedef-----------------------------------*/
enum
{
    /**
     * @brief # NONE, NO Function
     * @param None NULL
     * @author zhengziyang (zhengziyang@zh-jieli.com)
     */
    TWS_NOTIFY_NONE,
    /**
     * @brief # Notify who `was competed`
     * @param data The address of BT device `who competed` the a2dp steam
     * @author zhengziyang (zhengziyang@zh-jieli.com)
     */
    TWS_NOTIFY_COMPETED,
    /**
     * @brief # Notify TWS to `compete back` the a2dp stream
     * @param data NULL
     * @author zhengziyang (zhengziyang@zh-jieli.com)
     */
    TWS_NOTIFY_COMPETE_BACK
};
typedef u8 tws_notify_TypeDef;
/*----------------------------------variable----------------------------------*/

/*-------------------------------------os-------------------------------------*/

/*----------------------------------function----------------------------------*/
/**
 * @brief  ## please `call in` spp recieve handler(`online_spp_recieve_cbk`)
 * @param  rec_data         recieved data pointer `with` frame head(raw data)
 * @param  len              data total length
 * @param  bt_addr          the address of the BT device who sent this packet
 * @author zhengziyang (zhengziyang@zh-jieli.com)
 */
void tws_notify_recieve_callback(void *rec_data,u16 len, u8 *bt_addr);

/**
 * @brief ## send a packet to a specified BT device by BT address
 * @param  bt_addr          The BT device send to
 * @param  tws_notify       TWS notify type, LIKE `TWS_NOTIFY_XXX`
 * @param  data             Additional data, which will be hint in enum TWS_NOTIFY_XXX
 * @param  len              Additional data length
 * @return int 
 * @author zhengziyang (zhengziyang@zh-jieli.com)
 */
int tws_notify_send(u8 *bt_addr, tws_notify_TypeDef tws_notify, void *data, int len);
/*------------------------------------test------------------------------------*/

#ifdef __cplusplus
}
#endif

#endif	/* TWS_NOTIFY_H */
